import request from '@/utils/request'

export function fetchArticleList(params) {
    return request({
        url: '/study/virtual-space/page',
        method: 'get',
        params: params
    })
}


export function getWhiteMusic(params) {
    return request({
        url: '/study/white-noise/page',
        method: 'get',
        params: params
    })
}

export function articleInfo(params) {
    return request({
        url: '/study/virtual-space/virtual-space-background/page',
        method: 'get',
        params: params
    })
}




export function getHot(type) {
    return request({
        url: '/study/hot',
        method: 'get',
        params: {
            type: type
        }
    })
}


export function emailLogin(data) {
    return request({
        url: '/member/auth/login',
        method: 'post',
        data: data
    })
}

export function forgetPassword(data) {
    return request({
        url: '/member/user/reset-password',
        method: 'put',
        data: data
    })
}
export function logout() {
    return request({
        url: '/member/auth/logout',
        method: 'post'
    })
}

export function sendEmailCode(data) {
    return request({
        url: '/member/auth/send-sms-code',
        method: 'post',
        data: data
    })
}
export function emailRegister(data) {
    return request({
        url: '/member/auth/sms-login',
        method: 'post',
        data: data
    })
}

export function updateUserInfo(data) {
    return request({
        url: '/member/user/update',
        method: 'put',
        data
    })
}
export function getUserInfo(userId) {
    return request({
        url: '/member/user/getUserInfoAll',
        method: 'get',
        params: {
            userId: userId
        }
    })
}

export function upload(data) {
    return request({
        url: '/infra/file/upload',
        method: 'POST',
        headers: {
            'Content-Type': 'multipart/articles-data',
            'Tenant-Id': '1'
        },
        data
    })
}

export function featchCategory(data) {
    return request({
        url: '/system/dict-data/type',
        method: 'get',
        params: data
    })
}

export function collect(id) {
    return request({
        url: '/v1/collect/collect',
        method: 'get',
        params: {
            articleId: id
        }
    })
}


